Table of Contents
Fixed Positioning Content

Overview

EO.Pdf ACM uses a layout model that is very similar to that of the Web, however the ACM layout engine does not directly support "position:absolute" like the standard CSS in Web. There are several ways to implement absolute positioned content.

Using Child AcmRender

The easiest way to render "out of flow" contents is to handle the AcmRender's BeforeRenderPage or AfterRenderPage event and creates a child AcmRender object to run a completely separately rendering process on the page. See here for more details about this technique.

Using Floated Blocks

You can take a block "out of the flow" by putting it inside a parent block, then float the block inside the parent block. Because the parent block only contains floated blocks, it is considered to be zero height and is ignored from the layout.

Assume the following code is called when the page is blank (for example, right after an AcmPageBreak) and the page has a top margin of 1 inch. The code would write text "page header" into the margin area at (7, 0.5). After block1 the whole regular page output area is still available for inline contents because block1 does not have any non-floating contents, thus does not consume any region on the layout. This produces the same "taking contents out of flow" result as "position:absolute" does in Web.

//block1 is used to host floating block2        
AcmBlock block1 = new AcmBlock();

//block2 is positioned at the 
AcmBlock block2 = new AcmBlock(new AcmText("page header"));
block2.Style.Top = -0.5f;
block2.Style.Left = 0;
block1.Children.Add(block2);

//other page contents
.....

Using Low Level Content API

Alternatively, you can also use low level content API to place raw contents directly on the page. Raw contents are contents that are directly placed on the page at a specific location, thus they are "out of flow" by nature.